-- phpMyAdmin SQL Dump
-- version 3.5.6
-- http://www.phpmyadmin.net
--
-- Host: csweb.studentnet.int
-- Generation Time: Jan 31, 2013 at 08:41 PM
-- Server version: 5.5.29
-- PHP Version: 5.3.19

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `cs414`
--

-- --------------------------------------------------------

--
-- Table structure for table `cs_answer`
--

DROP TABLE IF EXISTS `cs_answer`;
CREATE TABLE IF NOT EXISTS `cs_answer` (
  `answer_id` int(11) NOT NULL AUTO_INCREMENT,
  `is_correct` int(11) NOT NULL,
  `answer_text` varchar(500) NOT NULL,
  `question_id` int(11) NOT NULL,
  PRIMARY KEY (`answer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `cs_authentication`
--

DROP TABLE IF EXISTS `cs_authentication`;
CREATE TABLE IF NOT EXISTS `cs_authentication` (
  `user_id` int(11) NOT NULL AUTO_INCREMENT,
  `email` varchar(35) NOT NULL,
  `salt_hash` int(100) NOT NULL,
  `last_name` int(15) NOT NULL,
  `first_name` int(15) NOT NULL,
  `power_id` int(3) NOT NULL,
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `cs_course`
--

DROP TABLE IF EXISTS `cs_course`;
CREATE TABLE IF NOT EXISTS `cs_course` (
  `course_id` int(11) NOT NULL AUTO_INCREMENT,
  `full_name` varchar(40) NOT NULL,
  `short_hand` varchar(10) NOT NULL,
  PRIMARY KEY (`course_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `cs_enrollment`
--

DROP TABLE IF EXISTS `cs_enrollment`;
CREATE TABLE IF NOT EXISTS `cs_enrollment` (
  `user_id` int(11) NOT NULL,
  `course_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `cs_grade`
--

DROP TABLE IF EXISTS `cs_grade`;
CREATE TABLE IF NOT EXISTS `cs_grade` (
  `user_id` int(11) NOT NULL,
  `test_id` int(11) NOT NULL,
  `grade_id` int(11) NOT NULL AUTO_INCREMENT,
  `grade` decimal(10,0) NOT NULL,
  `date_posted` datetime NOT NULL,
  `course_id` int(11) NOT NULL,
  PRIMARY KEY (`grade_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `cs_question`
--

DROP TABLE IF EXISTS `cs_question`;
CREATE TABLE IF NOT EXISTS `cs_question` (
  `question_id` int(11) NOT NULL AUTO_INCREMENT,
  `question_type` int(2) NOT NULL,
  `question_text` int(250) NOT NULL,
  PRIMARY KEY (`question_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `cs_questions_used`
--

DROP TABLE IF EXISTS `cs_questions_used`;
CREATE TABLE IF NOT EXISTS `cs_questions_used` (
  `course_id` int(11) NOT NULL,
  `test_id` int(11) NOT NULL,
  `question_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `cs_test`
--

DROP TABLE IF EXISTS `cs_test`;
CREATE TABLE IF NOT EXISTS `cs_test` (
  `test_id` int(11) NOT NULL AUTO_INCREMENT,
  `course_id` int(11) NOT NULL,
  `name` varchar(40) NOT NULL,
  `description` varchar(500) NOT NULL,
  `visible` tinyint(1) NOT NULL,
  `start_time` datetime NOT NULL,
  `end_time` datetime NOT NULL,
  `auto_grade` tinyint(1) NOT NULL,
  PRIMARY KEY (`test_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
